$(document).ready(function(){
	
	$('form.admin-form input[type=submit]').css('background-color' ,'#c0c0c0');
	$('form.admin-form input[type=text]').css('background-color' ,'#fff').css('border' ,'none');
	$('form.admin-form select.dropdown').css('background-color' ,'#fff').css('border' ,'none');
	
	$('#enable_edit').click(function(){
		if( $(this).is (':checked'))
		{
			$('form.admin-form input[type=text],form.admin-form input[type=submit],form.admin-form select.dropdown').removeAttr("disabled");
			$('form.admin-form input[type=submit]').css('background-color' ,'#90EE90');
			$('form.admin-form input[type=text]').css('background-color' ,'#c0c0c0').css('border' ,'1px solid #000').css('padding','5px 6px');
			$('form.admin-form input[type=text]').css('background-color' ,'#c0c0c0').css('border' ,'1px solid #000').css('padding','5px 6px');
			$('form.admin-form select.dropdown').css('background-color' ,'#fff').css('border' ,'1px solid #000');
		}else
		{
			$('form.admin-form input[type=text],form.admin-form input[type=submit],form.admin-form select.dropdown').attr("disabled" , true);
			$('form.admin-form input[type=submit]').css('background-color' ,'#c0c0c0');
			$('form.admin-form input[type=text]').css('background-color' ,'#fff').css('border' ,'none');
			$('form.admin-form select.dropdown').css('background-color' ,'#fff').css('border' ,'none');
			
		}
	});
	
	$('form.admin-form input[type=text]').click(function(){	
			$(this).animate({width:'400px'});
		}).blur(function(){
			$(this).animate({width:'162px'});
	});
	
	
	
	function detect_checkbox(){
		if( $('#enable_edit').is (':checked'))
		{
			$('form.admin-form input[type=text],form.admin-form input[type=submit],form.admin-form select.dropdown').removeAttr("disabled");
			$('form.admin-form input[type=submit]').css('background-color' ,'#90EE90');
			$('form.admin-form input[type=text]').css('background-color' ,'#c0c0c0').css('border' ,'1px solid #000').css('padding','5px 6px');
			$('form.admin-form input[type=text]').css('background-color' ,'#c0c0c0').css('border' ,'1px solid #000').css('padding','5px 6px');
			$('form.admin-form select.dropdown').css('background-color' ,'#fff').css('border' ,'1px solid #000');
		}else
		{
			$('form.admin-form input[type=text],form.admin-form input[type=submit],form.admin-form select.dropdown').attr("disabled" , true);
			$('form.admin-form input[type=submit]').css('background-color' ,'#c0c0c0');
		}
	}
	$('form.admin-form input[type=submit],form.admin-form input[type=submit],form.admin-form select.dropdown').attr('disabled','disabled');
	detect_checkbox();
});